package com.loan.service;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

import com.jfinal.plugin.activerecord.Page;
import com.loan.model.Slider;

public class SliderService extends BaseService<Slider>{
	
	/**
	 * 查找所有可用轮播图
	 */
	public List<Slider> findEnable() { 
		return Slider.dao.find("select * from slider where status='正常' order by dsporder desc"); 
	}	 
	
	/** 
	 * 分页数据
	 */
	public Page<Slider> list(int page, int size, Map<String, String> map) {
		return Slider.dao.paginate(page, size, buildSql("slider",Arrays.asList("type", "name", "status"),map," order by dsporder desc,status asc "));
	}
}
